<template>
	<view class="page">
	<text @click="onChild">{{child}}</text>
	<text>{{title}}</text>
	</view>
</template>

<script>
	export default{
		data:function() {
			return{
				child:'这是子组件的值'
			}
		},
		methods:{
			onChild:function(){
				console.log("触发子组件事件，向父组件传递值");
				this.$emit('onFather',this.child);
			}
		},
		props:['title']
	}
</script>

<style>
	.page{
		width: 100%;
		height: 200rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		color: white;
		background-color: #007AFF;
	}
</style>
